<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>10-千千音乐盒实现全选反选</title>
	
<style type="text/css">




</style>
</head>
<body>
	
	<button>隐藏</button>
	<br><br>
	<div id="bg" style="background: pink;width: 200px;height: 200px;"></div>
	



<script src="jquery-3.4.1.min.js"></script>
<script type="text/javascript">

	$(document).ready(function(){

		let show = "yc"
		
		$("button").click(function(){
			$("#bg").toggle()
			if(show=="yc"){
				$("button").text("显示")
				show ="xianshi"
			}else if(show == "xianshi"){
				$("button").text("隐藏")
				show = "yc"
			}


		})


	})
</script>





</body>
</html>